/*
 * Segment.h
 *
 *  Created on: Mar 24, 2011
 *      Author: hxu
 */

#ifndef SEGMENT_H_
#define SEGMENT_H_
#include"Point.h"

namespace Cxuh {

template<class Type> class Segment {
	template<class TT> friend class Tree;
public:
	Segment(): startpt(NULL), endpt(NULL) {};	// for inherited classes
	Segment(Point<Type> *pt1, Point<Type> *pt2, double rint, double cint, int length);	// x1, y1, x2, y2
	virtual ~Segment();
	template<class TT> friend std::ostream& operator << (std::ostream&, Segment<TT>&);
	double getR();
	double getC();
	int getLength();
	Cxuh::Point<Type> * getStart();
	Cxuh::Point<Type> * getEnd();
protected:
	Cxuh::Point<Type>* startpt, *endpt;
	int l;
	double r, c;	// unit electrical characteristics
};

}
#endif /* SEGMENT_H_ */
